package promote.brozen.base.stack;

import promote.brozen.utils.concurrent.Threads;

import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.concurrent.locks.LockSupport;

/**
 * @author Brozen
 * @date 2020/8/13 3:28 PM
 * @email brozen@qq.com
 */
public class StackSize {

    public static void main(String[] args) {
        Thread[] threads = new Thread[100];
        for (int i = 0; i < 100; i++) {
            threads[i] = new Thread(() -> {
                long l = 100L;
                byte[] m = new byte[1024 * 1024 ];
                Threads.silentSleep(10000000L);
            });
            threads[i].start();
        }

        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
        System.out.println(runtimeMXBean.getName());
        LockSupport.park();
    }


    class Node {
        byte by;
        long ll;

        public Node(byte by, long ll) {
            this.by = by;
            this.ll = ll;
        }
    }

}
